-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support conversation_style
of openai
format (OpenAI API style)
#890
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/890
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 95f2386 with merge base ea3d4ea (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xingyaoww for this addition! Overall looks great, just some minor comments.
Would be great if you can add a unit test for this as well. I also realized the sharegpt converter is missing a unit test also (I know, how could we) but both of these should be tested. Upto you if you also want to cover that :)
Co-authored-by: Rafi Ayub <33648637+RdoubleA@users.noreply.github.com>
Co-authored-by: Rafi Ayub <33648637+RdoubleA@users.noreply.github.com>
Co-authored-by: Rafi Ayub <33648637+RdoubleA@users.noreply.github.com>
conversation_style
of standard_chat
format (OpenAI API style)conversation_style
of openai
format (OpenAI API style)
@RdoubleA Thanks a ton for the review!!! I should fixed all the test issues in the latest commit and can confirm all tests passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to go! and thanks for the additional test! let me start the github CI and see what it thinks
torchtune/data/_converters.py
Outdated
Convert a chat sample adhering to the OpenAI API standard chat format to the Llama2 chat format. | ||
|
||
OpenAI API `standard chat format <https://platform.openai.com/docs/guides/text-generation/chat-completions-api>`_ follows:: | ||
Check https://platform.openai.com/docs/guides/text-generation/chat-completions-api for more details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
@xingyaoww Looks like just a lint error which you should be able to fix with |
@RdoubleA should be fixed! |
Context
What is the purpose of this PR? Is it to
Please link to any issues this PR addresses.
This adds a
conversation_style
ofopenai
, similar to theopenai
one by @musabgultekin in #824 (comment).Changelog
What are the changes made in this PR?
openai_to_llama2_messages
It now supports converting sample like (following OpenAI API) the following directly to internal
llama2_messages
.Example usage in config:
Test plan
Please make sure to do each of the following if applicable to your PR. (If you're not sure about any one of these just ask and we will happily help.)
pre-commit install
)pytest tests
pytest tests -m integration_test